#ifndef MYPUSHBUTTON_H
#define MYPUSHBUTTON_H

#include <QPushButton>

class MyPushButton : public QPushButton
{
    Q_OBJECT
public:
    explicit MyPushButton(QWidget *parent = nullptr);
    void Set_Image(const QString& normal,const QString& hover,const QString& pressed);



protected:
    //鼠标按下
    void mousePressEvent(QMouseEvent* ev);
    //鼠标释放
    void mouseReleaseEvent(QMouseEvent* ev);
    //鼠标经过
    void enterEvent(QEvent* ev);
    //鼠标离开
    void leaveEvent(QEvent* ev);
    //绘图
    void paintEvent(QPaintEvent* ev);

signals:
private:
    QString normal_;
    QString hover_;
    QString pressed_;
    QPixmap pixmap_;
};

#endif // MYPUSHBUTTON_H
